package com.capgemini.scaffold.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.capgemini.scaffold.common.valid.AddGroup;
import com.capgemini.scaffold.common.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 导师实体类
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("TUTOR")
public class Tutor {
    //导师id
    @NotNull(message = "修改必须指定id",groups = {UpdateGroup.class})
    @Null(message = "新增不能指定id",groups = {AddGroup.class})
    @TableId(type = IdType.AUTO)
    private Integer id;
    //导师名字
    @NotBlank(message = "新增/修改学员姓名不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("NAME")
    private String name;
    //导师性别
    @TableField("SEX")
    private String sex;
    //导师性别
    @NotBlank(message = "新增/修改导师性别不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String sexName;
    //导师职级
    @NotBlank(message = "新增/修改导师职级能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("JOB_GRADE")
    private String jobGrade;
    //导师职位类型
    @TableField("JOB")
    private String job;
    //导师职位类型
    @NotBlank(message = "新增/修改导师职位类型不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String jobName;
    //导师邮箱
    @Email(message = "新增/修改导师邮箱格式错误",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("MAIL")
    private String mail;


}
